import request from '@/config/axios'

// 用户信息 VO
export interface MemberUserVO {
  id: number // 用户ID
  orgId: number // 所属组织
  name: string // 姓名
  username: string // 用户账号
  password: string // 密码
}

// 用户信息 API
export const MemberUserApi = {
  // 查询用户信息分页
  getMemberUserPage: async (params: any) => {
    return await request.get<PageResult<MemberUserVO[]>>({ url: `/pb/member-user/page`, params })
  },

  // 查询用户信息详情
  getMemberUser: async (id: number) => {
    return await request.get({ url: `/pb/member-user/get?id=` + id })
  },

  // 新增用户信息
  createMemberUser: async (data: MemberUserVO) => {
    return await request.post({ url: `/pb/member-user/create`, data })
  },

  // 修改用户信息
  updateMemberUser: async (data: MemberUserVO) => {
    return await request.put({ url: `/pb/member-user/update`, data })
  },

  // 删除用户信息
  deleteMemberUser: async (id: number) => {
    return await request.delete({ url: `/pb/member-user/delete?id=` + id })
  },

  // 导出用户信息 Excel
  exportMemberUser: async (params) => {
    return await request.download({ url: `/pb/member-user/export-excel`, params })
  },
}
